close() callback hangs instead of unblocking current window

Probably a simple problem but:

I have a window with an OK button: window is displayed via block() so that when done, another window can be shown. It works fine.

But I want to remove the standard close button (just have my OK button):
so I added a line for a close() button with 2nd arg FALSE so close button will not be visible.
(BTW - I tried omitting callback argument for the close() button, but that is a DXL error per DOORS although the help kind of suggests you could do that ["When a callback function is supplied, ...".)

Problem now is when you click on the "X" in the top right of the window to close it (which invokes the close() button's callback), DOORS hangs. Here is the relevant code:

...
void closeModSelGUI(DB dbSpecifyModulesGUI)
{
    hide(dbSpecifyModulesGUI)
        destroy(dbSpecifyModulesGUI)
}
...
close(dbSpecifyModulesGUI,false,closeModSelGUI) //remove the normal close button
block(dbSpecifyModulesGUI)
...

 


Anyone know how to get this callback to cause the code to continue from after the block()???

Thanks

 


strathglass - Thu Mar 03 07:50:07 EST 2011

Re: close() callback hangs instead of unblocking current window
llandale - Thu Mar 03 11:00:55 EST 2011

"block"ed dialogs must be "release"d in order to get the code to continue after the "block" command. So the callbacks must issue "release(dbSpecifyModulesGUI)"

As I've stated in posts some time ago, you should treat dialogs that are intended for "block" differently than those intended for "show". It works out well if "blocked" dialogs are hidden and destoryed in code AFTER the "block", which means that custom close callbacks need only "release". Other button and apply callbacks may or may not "release". However, if you rigorously use a custom "close" callback that contains the one and only "release" for that dialog (and the close could be called by other callbacks), then I suppose that close callback could hide/destroy/release and you would not need to hide/destroy after the block.

  • Louie

Re: close() callback hangs instead of unblocking current window
Mathias Mamsch - Thu Mar 03 11:01:00 EST 2011

Never call destroy from a callback. Put your code like this:
 

void closeModSelGUI(DB dbSpecifyModulesGUI)
{
    hide(dbSpecifyModulesGUI)
}
...
close(dbSpecifyModulesGUI,false,closeModSelGUI) //remove the normal close button
block(dbSpecifyModulesGUI)
...
destroy dbSpecifyModulesGUI

 


Regards, Mathias

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

Re: close() callback hangs instead of unblocking current window
strathglass - Mon Mar 07 06:11:45 EST 2011

Action: release() added to callback, and destroy() moved too.
Status: working greate now.

Thanks!

-strathglass